import request from '@/utils/request'

// 获取角色菜单权限
export function getMenuList(roleId, scope) {
  return request({
    url: `/kd_manage/role_resource/${scope}/menu_list`,
    method: 'post',
    params: {
      roleId
    }
  })
}

// 获取角色资源权限
export function listRoleResource(roleId, scope) {
  return request({
    url: `/kd_manage/role_resource/${scope}/set_menus`,
    method: 'get',
    params: {
      roleId
    }
  })
}

// 更新角色菜单
export function setRoleMenus(roleId, menuList, scope) {
  return request({
    url: `/kd_manage/role_resource/${scope}/set_menus`,
    method: 'post',
    data: {
      roleId: roleId,
      menus: menuList
    }
  })
}
